//初始化方法
YX.fn.choose_user_checkbox = function() {
	this.$chooseUserModal = $("#chooseUserModal")
	this.$chooseUserModal.delegate('#cuc-confirm', 'click', this.addTeamUsers.bind(this))
}

YX.fn.addTeamUsers = function() {
	//判断是否做了选择
	var chooseUserLen = Object.getOwnPropertyNames(addTeamUsers_chooseUserData.checkedUsers).length;
	if(chooseUserLen == 0) {
		return;
	}

	//整理成数组:
	var userArr = [];
	var accounts = []
	for(var key in addTeamUsers_chooseUserData.checkedUsers) {
		//只遍历对象自身的属性，而不包含继承于原型链上的属性。  
		if(addTeamUsers_chooseUserData.checkedUsers.hasOwnProperty(key) === true) {
			userArr.push(addTeamUsers_chooseUserData.checkedUsers[key]);
			accounts.push(addTeamUsers_chooseUserData.checkedUsers[key].id)
		}
	}

	var teamId = this.addTeamMemberTag && this.crtSessionAccount,
		that = this
	this.mysdk.addTeamMembers({
		teamId: teamId,
		accounts: accounts,
		ps: '',
		done: function(error, params) {
			if(error) {
				alert('添加成员失败')
			}
		}
	})

	//向回调函数传入选择的用户
	/*	if(callback) {
			callback(userArr);
		}*/

	this.$createTeamContainer.addClass('hide')
	this.$teamInfoContainer.addClass('hide')
	this.$mask.addClass('hide')
	Modal.hide("#chooseUserModal");
}